import { PostRequest } from '@/utils/request'
import type { Response } from '@/utils/request'

export type UserCouponModel = {
  bigClassify: number
  brand: number
  couponName: string
  couponType: number
  detail: string
  discountAmount: number
  goodsDim: number
  loadingPage: string
  member: boolean
  productCoupon: number
  range: string
  resource: number
  satisfyAmount: number
  status: number
  validEndTime: string
  validStartTime: string
  showDetail: boolean
}

export type UserCouponData = {
  pages: number
  size: number
  total: number
  rows: UserCouponModel[]
}

/**
 * 生成对应的语音内容列表
 */
export function getUserCoupon(page: number, rows: number, type: number): Promise<Response<UserCouponData | null>> {
  return PostRequest('/api/wx/WxuserCoupons/getUserCoupon', {
    page,
    rows,
    type,
  })
}
